<template>
    <!-- 侧边栏 -->
    <el-aside width="200px" height="1000px">
        <el-scrollbar>
            <el-menu background-color="#545c64" text-color="#fff" :unique-opened="true">
                <!-- 课程设计任务栏 -->
                <el-sub-menu v-for="menu in obj.data" :key="menu.menuid" :index="menu.menuname">

                    <template #title>
                        <el-icon>
                            <Monitor />
                        </el-icon><span>{{ menu.menuname }}</span>
                    </template>
                    <el-menu-item-group v-for="chmenu in menu.menus" :index="'/' + chmenu.url" :key="chmenu.menuid">
                        <!-- <template #title>Group 1</template> -->
                        <el-menu-item @click="$router.push(chmenu.url)"><span>{{ chmenu.menuname }}</span></el-menu-item>
                    </el-menu-item-group>
                </el-sub-menu>
            </el-menu>
        </el-scrollbar>
    </el-aside>
</template>
<script lang="ts" setup>
import { ref, reactive } from 'vue'
import { Menu as IconMenu, Message, School, Bicycle, Monitor } from '@element-plus/icons-vue'
import { buildLocaleContext } from 'element-plus';
import router from '../router/index.js';

import { useRouter } from 'vue-router'
const router_useRouter = useRouter()


const obj = reactive({
    data: [
        {
            menuid: 1,
            icon: 'li-icon-xiangmuguanli',
            menuname: '信息管理',
            hasThird: null,
            url: null,
            menus: [
                {
                    menuid: 11,
                    icon: 'icon-order-manage',
                    menuname: '企业信息',
                    hasThird: 'N',
                    url: "companyhome",
                    menus: null
                },
                {
                    menuid: 12,
                    icon: 'icon-order-manage',
                    menuname: '教师信息',
                    hasThird: 'N',
                    url: "companyteacher",
                    menus: null
                },
                {
                    menuid: 13,
                    icon: 'icon-order-manage',
                    menuname: '学生评价',
                    hasThird: 'N',
                    url: "studentEvaluate",
                    menus: null
                },
            ]
        },
    ],

})

</script>

